﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using System.Drawing;
using System.Diagnostics;
using System.Web.Script.Services;

namespace ModuleTestSite
{
    [ScriptService]
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [WebMethod]
        public static string GetRandomColor()
        {
            Random r = new Random();
            
            byte[] colors = new byte[3];
            r.NextBytes(colors);

            string ret = string.Format("#{0:X2}{1:X2}{2:X2}", colors[0], colors[1], colors[2]);
            
            Debug.WriteLine(ret);
            
            return ret;
        }
    }
}
